package com.ruoyi.fetvApi.controller;

import com.ruoyi.common.annotation.Anonymous;
import com.ruoyi.common.core.controller.BaseController;
import com.ruoyi.common.core.domain.AjaxResult;
import com.ruoyi.common.core.page.TableDataInfo;
import com.ruoyi.fetvApi.domain.FetvSchoolApi;
import com.ruoyi.fetvApi.mapper.FetvSchoolApiMapper;
import com.ruoyi.fetvApi.service.IFetvSchoolApiService;
import org.springframework.web.bind.annotation.*;

import javax.annotation.Resource;
import java.util.List;

/**
 * 学校Controller
 * 
 * @author éé­æ°
 * @date 2023-02-24
 */
@CrossOrigin(origins = "http://ruoyi.vip", maxAge = 3600)
@RestController
@RequestMapping("/index/fetv/school")
public class FetvSchoolApiController extends BaseController
{
    @Resource
    private IFetvSchoolApiService fetvSchoolService;

    @Resource
    private FetvSchoolApiMapper fetvSchoolApiMapper;


    /**
     * 获取学校详细信息
     */
    @Anonymous
    @GetMapping
    public AjaxResult getInfo(@RequestParam Integer schoolId)
    {
        return success(fetvSchoolService.selectFetvSchoolBySchoolId(schoolId));
    }

    /**
     * 院校详情 返回三个院校对象，包含图片 学校名 学校地址还有学校id
     * @param fetvSchoolApi
     * @return
     */
    @Anonymous
    @GetMapping("/schoolList")
    public TableDataInfo schoolList(FetvSchoolApi fetvSchoolApi)
    {
        List<FetvSchoolApi> list = fetvSchoolService.selectFetvSchoolApiList(fetvSchoolApi);
        return getDataTable(list);
    }



}
